<?php
/**
 * Eka Framework 0.3.0
 *
 * @copyright Copyright (c) 2008 Alexey Yu. Chuprina <656b61@gmail.com> (http://php-eka.googlecode.com)
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 *
 * @version $Id$
 */

/**
 * Eka_Db
 *
 * @package Db
 */
class Eka_Db
{
	const ADAPTER_PDO_MYSQL = 'Pdo_Mysql';
	
	/**
	 * Factory for Eka_Db_Adapter_Abstract classes
	 *
	 * @param string $adapter
	 * @param string $host
	 * @param string $username
	 * @param string $password
	 * @param mixed $config
	 * @param string $charset
	 * @return Eka_Db_Adapter_Abstract
	 */
	static public function factory($adapter, $host, $username, $password, $config = null, $charset = null)
	{
		$adapter = 'Eka_Db_Adapter_' . $adapter;
		Eka_Autoloader::load($adapter);
		return new $adapter($host, $username, $password, $config, $charset);
	}
}